class GitDataBlobs
  attr_accessor :github

  def initialize(github)
    @github = github
  end

  def getBlob(repo, sha, user=nil)
    username = user == nil ? @github.username : user
    @github.get(
        'repos/%s/%s/git/blobs/%s' % [username, repo, sha])
  end

  def createBlob(repo, content, encoding, user=nil)
    username = user == nil ? @github.username : user
    params = {
        :content => content,
        :encoding => encoding
    }
    data = params.to_json
    @github.post('repos/%s/%s/git/blobs' % [username, repo],
                 data)
  end
end